define(['jquery', 'bootstrap', 'select2', 'validate', 'validate.en', 'shiftform', 'koala-search', 'modalSearch'],
        
function($, validate) {
  
  return {
    
    init: function() {
      this.initDriver();
    },
    
    initDriver: function() {
        
        var choseDrivers = {
            url: function(){
                var url = window.__CTX__.root + '/drivers/query';
                return url + "?supplierId=" + $('input[name="supplierId"]').val();
              },
            tableColumns: ['司机代码', '司机名称'],
            tableValues: ['code', 'name'],
            displayValues: ['code', 'name'],
            values: ['id']
         }
         $('[data-target="#modal-search-driverId"]').modalsearch(choseDrivers);
         $('[data-target="#modal-search-copilotId"]').modalsearch(choseDrivers);
         
         var options = {
           time: 1000,
           url: window.__CTX__.root + "/drivers/query",
           queryName: "code",
           value: ["id"],
           display: ["code", "name"]
         }
       
         $('.driverId-search').koalaSearch(options);
         $('.copilotId-search').koalaSearch(options);
        
      }
    
    
  }
})